package com.lhy.xiancheng;

public class Test69 {

    public static void main(String[] args) {
        DisplayMessage hello = new DisplayMessage("你好");
        Thread thread1 = new Thread(hello);
        thread1.setDaemon(true);
        thread1.setName("hello");
        System.out.println("Starting 你好 thread...");
        thread1.start();//开始使用线程。

        DisplayMessage bye = new DisplayMessage("再见");
        Thread thread2 = new Thread(bye);
        thread2.setPriority(Thread.MIN_PRIORITY);
        thread2.setDaemon(true);
        System.out.println("Starting 再见 thread...");
        thread2.start();////开始使用线程。

        System.out.println("线程三");
        GuessANumber thread3 = new GuessANumber(5);
        thread3.start();
        try {
            thread3.join();
        } catch (InterruptedException e) {
            System.out.println("Thread interrupted.");
        }
        System.out.println("线程4");
        GuessANumber thread4 = new GuessANumber(40);

        thread4.start();
        System.out.println("main方法结束");
    }
}
